package com.meituan.catering.management.order.biz.model;

import com.meituan.catering.management.order.api.http.model.enumeration.CateringOrderItemAccessoryStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 订单子项加料实例BO定义
 */
@Data
public class CateringOrderItemAccessoryBO {

    @ApiModelProperty("物理ID")
    private Long id;

    @ApiModelProperty("版本号")
    private Integer version;

    @ApiModelProperty("序号")
    private String seqNo;

    @ApiModelProperty("状态")
    private CateringOrderItemAccessoryStatusEnum status;

    @ApiModelProperty("数量信息")
    private final Quantity quantity = new Quantity();

    @ApiModelProperty("下单时刻的商品加料快照")
    private final ProductAccessorySnapshot productAccessorySnapshotOnPlace = new ProductAccessorySnapshot();

    @Data
    @ApiModel("数量快照")
    public static class Quantity {

        @ApiModelProperty("当前数量")
        private BigDecimal latest;

        @ApiModelProperty("下单数量")
        private BigDecimal onPlace;

        @ApiModelProperty("出餐数量")
        private BigDecimal onProduce;
    }

    @Data
    @ApiModel("商品加料快照")
    public static class ProductAccessorySnapshot {

        @ApiModelProperty("物理ID")
        private Long id;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("备注")
        private String groupName;

        @ApiModelProperty("单价")
        private BigDecimal unitPrice;

        @ApiModelProperty("计量单位")
        private String unitOfMeasure;

    }

}
